import Vue from 'vue'
import VueRouter from 'vue-router'

import mainpage from '../views/mainpage'
import maingagemedicine from '../views/mainpagemedicine'
import maingagemedicine2 from '../views/mainpagemedicine2'
import medicinedetail from '../views/medicinedetail'
import medicine2detail from '../views/medicine2detail'
import knowledgedetail from '../views/knowledgedetail'
import setting from '../views/setting'
import likepage from '../components/likepage.vue'

// const mainpage = () => import('../views/mainpage')

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    name:'首页',
    component:mainpage
  },
  {
    path:'/mainpage',
    name:'首页',
    component:mainpage
  },
  {
    path:'/mainpagemedicine',
    name:'中药索引',
    component:maingagemedicine
  },
  {
    path:'/mainpagemedicine2',
    name:'方剂索引',
    component:maingagemedicine2
  },
  {
    path:'/setting',
    name:'设置',
    component:setting
  },
  {
    path:'/medicinedetail/:id',
    name:'中药详情',
    component:medicinedetail
  },
  {
    path:'/medicine2detail/:id',
    name:'方剂详情',
    component:medicine2detail
  },
  {
    path:'/knowledgedetail/:id',
    name:'知识详情',
    component:knowledgedetail
  },
  {
    path:'/likepage',
    name:' 我的收藏夹',
    component:likepage
  },
  
]

const router = new VueRouter({
  routes
})

export default router
